package com.cheer.constant;

/**
 * 集群角色枚举
 *
 * @author cheer
 */
public enum AwardEnum {

    SINGLE(1L, "青年大学习笔记本"),
    MASTER(2L, "限量帆布包(黑)"),
    SLAVE(3L, "限量帆布包(白)");

    private Long code;
    private String message;

    AwardEnum(Long code, String message) {
        this.code = code;
        this.message = message;
    }

    public Long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String forCode(Long code) {
        if (code == null) {
            return null;
        }
        for (AwardEnum containerRoleEnum : AwardEnum.values()) {
            if (containerRoleEnum.code.equals(code)) {
                return containerRoleEnum.getMessage();
            }
        }
        return null;
    }
}
